package com.estiag.rocketmq.boot;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class SpringBootProducer {
    @Resource
    private RocketMQTemplate rocketMQTemplate;

    @GetMapping("/hi")
    public String send() {
        rocketMQTemplate.convertAndSend("topic", "hi");
        return "ok";
    }
}
